home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / Interfaces / CPlusPlus / Document.xh < prev    next >
Encoding:
Text File  |  1997-02-13  |  8.5 KB  |  362 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: Document.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes defined in this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODDocument_xh
  18. #define SOM_ODDocument_xh
  19.  
  20. class ODDocument;
  21.  
  22. #define ODDocument_MajorVersion 1
  23. #define ODDocument_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODRefCntObject_xh
  31. #include <RefCtObj.xh>
  32. #endif
  33.  
  34. #ifndef ODDocument_API
  35. #define ODDocument_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODRefCntObject;
  50. class ODDocument;
  51. class ODContainer;
  52. class ODDraft;
  53. class ODStorageUnit;
  54.  
  55. /*
  56.  * End of user-defined types.
  57.  */
  58.  
  59. #ifdef OLDIBMSOMAPISUPPORT
  60. #define ODDocumentCClassData ODDocumentClassData
  61. #define ODDocumentNewClass(major,minor) somNewVersionedClassReference(ODDocument,major,minor)
  62. #endif
  63.  
  64. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  65. #define ODDocumentMetaClass SOMClass
  66.  
  67. #if PRAGMA_ALIGN_SUPPORTED
  68. #  pragma options align=power
  69. #endif
  70.  
  71. /* The API to the ODDocument class object, and the methods it introduces. */
  72. SOMEXTERN struct ODDocumentClassDataStructure {
  73. #ifdef OLDIBMSOMAPISUPPORT
  74.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  75. #else
  76.     long zero;
  77. #endif
  78.     somStaticClassInfo *sci;
  79.     somDToken        instanceDataToken;
  80.     long reserved [3];
  81.     somMToken GetContainer;
  82.     somMToken GetID;
  83.     somMToken GetName;
  84.     somMToken SetName;
  85.     somMToken CollapseDrafts;
  86.     somMToken AcquireDraft;
  87.     somMToken Exists;
  88.     somMToken AcquireBaseDraft;
  89.     somMToken CreateDraft;
  90.     somMToken SaveToAPrevDraft;
  91.     somMToken SetBaseDraftFromForeignDraft;
  92.     somMToken reserved1;
  93.     somMToken reserved2;
  94. } SOMDLINK ODDocumentClassData;
  95.  
  96. #if PRAGMA_ALIGN_SUPPORTED
  97. #  pragma options align=reset
  98. #endif
  99.  
  100. #if !defined(ODDocument_Class_Source) && !defined(SOM_Module_document_Source)
  101. #if PRAGMA_IMPORT_SUPPORTED
  102. #pragma import list ODDocumentClassData
  103. #endif
  104. #endif
  105.  
  106.  
  107. /*
  108.  * -- Typedefs and inline method declarations for left path inherited methods
  109.  * -- are omitted because this compilation had -museinheritedmethods in effect
  110.  */
  111.  
  112.  
  113. /*
  114.  * -- Typedefs for ODDocument Method Procedures
  115.  */
  116. SOMEXTERN {
  117. typedef ODContainer*   (* SOMLINK somTD_ODDocument_GetContainer)(ODDocument *somSelf, Environment *ev);
  118. typedef ODDocumentID   (* SOMLINK somTD_ODDocument_GetID)(ODDocument *somSelf, Environment *ev);
  119. typedef ODDocumentName   (* SOMLINK somTD_ODDocument_GetName)(ODDocument *somSelf, Environment *ev);
  120. typedef void   (* SOMLINK somTD_ODDocument_SetName)(ODDocument *somSelf, Environment *ev,
  121.         ODDocumentName* name);
  122. typedef ODDocument*   (* SOMLINK somTD_ODDocument_CollapseDrafts)(ODDocument *somSelf, Environment *ev,
  123.         ODDraft* from,
  124.         ODDraft* to);
  125. typedef ODDraft*   (* SOMLINK somTD_ODDocument_AcquireDraft)(ODDocument *somSelf, Environment *ev,
  126.         ODDraftPermissions perms,
  127.         ODDraftID id,
  128.         ODDraft* draft,
  129.         ODPositionCode posCode,
  130.         ODBoolean release);
  131. typedef ODBoolean   (* SOMLINK somTD_ODDocument_Exists)(ODDocument *somSelf, Environment *ev,
  132.         ODDraftID id,
  133.         ODDraft* draft,
  134.         ODPositionCode posCode);
  135. typedef ODDraft*   (* SOMLINK somTD_ODDocument_AcquireBaseDraft)(ODDocument *somSelf, Environment *ev,
  136.         ODDraftPermissions perms);
  137. typedef ODDraft*   (* SOMLINK somTD_ODDocument_CreateDraft)(ODDocument *somSelf, Environment *ev,
  138.         ODDraft* below,
  139.         ODBoolean releaseBelow);
  140. typedef void   (* SOMLINK somTD_ODDocument_SaveToAPrevDraft)(ODDocument *somSelf, Environment *ev,
  141.         ODDraft* from,
  142.         ODDraft* to);
  143. typedef void   (* SOMLINK somTD_ODDocument_SetBaseDraftFromForeignDraft)(ODDocument *somSelf, Environment *ev,
  144.         ODDraft* draft);
  145. }
  146.  
  147. #endif /* ODDocument_API */
  148.  
  149.  
  150. /*
  151.  * -- This emitter treats Method Tokens as Thunks by default.
  152.  * -- Use the sc modifier "nothunks" to change this default
  153.  */
  154. #undef somresolve_
  155. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  156.  
  157. /*
  158.  * -- The C++ Wrapper Class for ODDocument
  159.  */
  160. class ODDocument : public ODRefCntObject
  161. {
  162. public:
  163.  
  164. // ODDocument::new registers use of the class object, and then uses somNew
  165. // to allocate memory and load the object method table pointer. 
  166. void *operator new(size_t size)
  167. {
  168.     SOM_IgnoreWarning(size);
  169.     // Allocate memory using the default allocator for ODDocument, and
  170.     // clear mem & set method table pointer, call basic initialization
  171. #ifdef SOMCHKNULL
  172.     void * __somResult = (void *)
  173.       somNewObject(ODDocument);
  174.     SOMCHKNULL(__somResult);
  175.     return __somResult;
  176. #else
  177.     return (void*) somNewObject(ODDocument);
  178. #endif
  179. }
  180.  
  181. // ODDocument::delete uses the default deallocator for the object's class.
  182. void operator delete(void * obj)
  183. {
  184.     if (obj) {
  185.         SOM_Resolve(obj,SOMObject,somFree)
  186.            ( (SOMObject*) obj );
  187.     }
  188. }
  189.  
  190. /* method: GetContainer */
  191. ODContainer*   GetContainer(Environment *ev)
  192. {
  193.    #ifdef SOMCHKEXCEPT
  194.    ODContainer* __somResult = 
  195.       SOM_ResolveD(this,ODDocument,ODDocument,GetContainer)
  196.     (this,ev);
  197.       SOMCHKEXCEPT;
  198.    return __somResult;
  199. #else
  200.    return SOM_ResolveD(this,ODDocument,ODDocument,GetContainer)
  201.     (this,ev);
  202. #endif
  203. }
  204.  
  205. /* method: GetID */
  206. ODDocumentID   GetID(Environment *ev)
  207. {
  208.    #ifdef SOMCHKEXCEPT
  209.    ODDocumentID __somResult = 
  210.       SOM_ResolveD(this,ODDocument,ODDocument,GetID)
  211.     (this,ev);
  212.       SOMCHKEXCEPT;
  213.    return __somResult;
  214. #else
  215.    return SOM_ResolveD(this,ODDocument,ODDocument,GetID)
  216.     (this,ev);
  217. #endif
  218. }
  219.  
  220. /* method: GetName */
  221. ODDocumentName   GetName(Environment *ev)
  222. {
  223.    #ifdef SOMCHKEXCEPT
  224.    ODDocumentName __somResult = 
  225.       SOM_ResolveD(this,ODDocument,ODDocument,GetName)
  226.     (this,ev);
  227.       SOMCHKEXCEPT;
  228.    return __somResult;
  229. #else
  230.    return SOM_ResolveD(this,ODDocument,ODDocument,GetName)
  231.     (this,ev);
  232. #endif
  233. }
  234.  
  235. /* method: SetName */
  236. void   SetName(Environment *ev,
  237.         ODDocumentName* name)
  238. {
  239.    SOM_ResolveD(this,ODDocument,ODDocument,SetName)
  240.     (this,ev,name);
  241. #ifdef SOMCHKEXCEPT
  242.       SOMCHKEXCEPT;
  243. #endif
  244. }
  245.  
  246. /* method: CollapseDrafts */
  247. ODDocument*   CollapseDrafts(Environment *ev,
  248.         ODDraft* from,
  249.         ODDraft* to)
  250. {
  251.    #ifdef SOMCHKEXCEPT
  252.    ODDocument* __somResult = 
  253.       SOM_ResolveD(this,ODDocument,ODDocument,CollapseDrafts)
  254.     (this,ev,from,to);
  255.       SOMCHKEXCEPT;
  256.    return __somResult;
  257. #else
  258.    return SOM_ResolveD(this,ODDocument,ODDocument,CollapseDrafts)
  259.     (this,ev,from,to);
  260. #endif
  261. }
  262.  
  263. /* method: AcquireDraft */
  264. ODDraft*   AcquireDraft(Environment *ev,
  265.         ODDraftPermissions perms,
  266.         ODDraftID id,
  267.         ODDraft* draft,
  268.         ODPositionCode posCode,
  269.         ODBoolean release)
  270. {
  271.    #ifdef SOMCHKEXCEPT
  272.    ODDraft* __somResult = 
  273.       SOM_ResolveD(this,ODDocument,ODDocument,AcquireDraft)
  274.     (this,ev,perms,id,draft,posCode,release);
  275.       SOMCHKEXCEPT;
  276.    return __somResult;
  277. #else
  278.    return SOM_ResolveD(this,ODDocument,ODDocument,AcquireDraft)
  279.     (this,ev,perms,id,draft,posCode,release);
  280. #endif
  281. }
  282.  
  283. /* method: Exists */
  284. ODBoolean   Exists(Environment *ev,
  285.         ODDraftID id,
  286.         ODDraft* draft,
  287.         ODPositionCode posCode)
  288. {
  289.    #ifdef SOMCHKEXCEPT
  290.    ODBoolean __somResult = 
  291.       SOM_ResolveD(this,ODDocument,ODDocument,Exists)
  292.     (this,ev,id,draft,posCode);
  293.       SOMCHKEXCEPT;
  294.    return __somResult;
  295. #else
  296.    return SOM_ResolveD(this,ODDocument,ODDocument,Exists)
  297.     (this,ev,id,draft,posCode);
  298. #endif
  299. }
  300.  
  301. /* method: AcquireBaseDraft */
  302. ODDraft*   AcquireBaseDraft(Environment *ev,
  303.         ODDraftPermissions perms)
  304. {
  305.    #ifdef SOMCHKEXCEPT
  306.    ODDraft* __somResult = 
  307.       SOM_ResolveD(this,ODDocument,ODDocument,AcquireBaseDraft)
  308.     (this,ev,perms);
  309.       SOMCHKEXCEPT;
  310.    return __somResult;
  311. #else
  312.    return SOM_ResolveD(this,ODDocument,ODDocument,AcquireBaseDraft)
  313.     (this,ev,perms);
  314. #endif
  315. }
  316.  
  317. /* method: CreateDraft */
  318. ODDraft*   CreateDraft(Environment *ev,
  319.         ODDraft* below,
  320.         ODBoolean releaseBelow)
  321. {
  322.    #ifdef SOMCHKEXCEPT
  323.    ODDraft* __somResult = 
  324.       SOM_ResolveD(this,ODDocument,ODDocument,CreateDraft)
  325.     (this,ev,below,releaseBelow);
  326.       SOMCHKEXCEPT;
  327.    return __somResult;
  328. #else
  329.    return SOM_ResolveD(this,ODDocument,ODDocument,CreateDraft)
  330.     (this,ev,below,releaseBelow);
  331. #endif
  332. }
  333.  
  334. /* method: SaveToAPrevDraft */
  335. void   SaveToAPrevDraft(Environment *ev,
  336.         ODDraft* from,
  337.         ODDraft* to)
  338. {
  339.    SOM_ResolveD(this,ODDocument,ODDocument,SaveToAPrevDraft)
  340.     (this,ev,from,to);
  341. #ifdef SOMCHKEXCEPT
  342.       SOMCHKEXCEPT;
  343. #endif
  344. }
  345.  
  346. /* method: SetBaseDraftFromForeignDraft */
  347. void   SetBaseDraftFromForeignDraft(Environment *ev,
  348.         ODDraft* draft)
  349. {
  350.    SOM_ResolveD(this,ODDocument,ODDocument,SetBaseDraftFromForeignDraft)
  351.     (this,ev,draft);
  352. #ifdef SOMCHKEXCEPT
  353.       SOMCHKEXCEPT;
  354. #endif
  355. }
  356.  
  357. };   /* ODDocument */
  358.  
  359.  
  360.  
  361. #endif       /* SOM_ODDocument_xh */
  362.